import request from '@/utils/request'

// 查询设备列表
export function listDevice(query) {
  return request({
    url: '/slope/device/list',
    method: 'get',
    params: query
  })
}

// 查询设备详细
export function getDevice(deviceId) {
  return request({
    url: '/slope/device/getInfo/' + deviceId,
    method: 'get'
  })
}

// 新增设备
export function addDevice(data) {
  return request({
    url: '/slope/device/add',
    method: 'post',
    data: data
  })
}

// 修改设备
export function updateDevice(data) {
  return request({
    url: '/slope/device/edit',
    method: 'post',
    data: data
  })
}

// 删除设备
export function delDevice(deviceId) {
  return request({
    url: '/slope/device/remove/' + deviceId,
    method: 'post'
  })
}

// 导出设备
export function exportDevice(query) {
  return request({
    url: '/slope/device/export',
    method: 'get',
    params: query
  })
}

// 首页设备状态统计
export function indexDeviceSum(query) {
  return request({
    url: '/slope/device/indexDeviceSum',
    method: 'get'
  })
}

//修改设备禁用启用状态
export function changeDeviceIsValid(data) {
  return request({
    url: '/slope/device/disable',
    method: 'post',
    data: data
  })
}
